/**
 * Created by bin.zhang on 14-11-11.
 */
define(['jquery','underscore','backbone','text!/android_asset/busAppWeb/module/busApp/appDialog/dialogPage.html'],
    function($,_,Backbone,html){
        var dialogPageView = Backbone.View.extend({
            template: _.template(html),
            initialize:function(){
                this.render();
            },

            render:function(){
                $('#dialogPage').html(this.template);
                $('#dialogPage').trigger("create");
            },

            setHeader:function(title){
                $('#dialogHeader')[0].innerText = title;
            },
            setFooter:function(footer){
                $('#dialogFooter')[0].innerText = footer;
            },
            setContent:function(content){
                $('#dialogContent')[0].innerHTML = content;
                $('body').trigger("create");
            },
            addListener:function(){
                $(document).ready(function(){
                    $('#backId').click(function(){
                        Backbone.history.navigate('#searchResultPage',true);
                    })
                })
            },

            remindRecord:function(callback){
                $(document).ready(function(){
                    $('#siteRemind a').click(function(){
                       callback($(this)[0].id);
                    })
                })
            }
        });
        return dialogPageView;
    }
)
